struct _GtkIconCache {
- gint ref_count;
+ int ref_count;
GMappedFile *map;
- gchar *buffer;
+ char *buffer;
guint32 last_chain_offset;
};
}
GtkIconCache *
-_gtk_icon_cache_new_for_path (const gchar *path)
+_gtk_icon_cache_new_for_path (const char *path)
{
GtkIconCache *cache = NULL;
GMappedFile *map;
- gchar *cache_filename;
- gint fd = -1;
+ char *cache_filename;
+ int fd = -1;
GStatBuf st;
GStatBuf path_st;
}
GtkIconCache *
-_gtk_icon_cache_new (const gchar *data)
+_gtk_icon_cache_new (const char *data)
{
GtkIconCache *cache;
cache = g_new0 (GtkIconCache, 1);
cache->ref_count = 1;
cache->map = NULL;
- cache->buffer = (gchar *)data;
+ cache->buffer = (char *)data;
return cache;
}
-static gint
+static int
get_directory_index (GtkIconCache *cache,
- const gchar *directory)
+ const char *directory)
{
guint32 dir_list_offset;
- gint n_dirs;
- gint i;
+ int n_dirs;
+ int i;
dir_list_offset = GET_UINT32 (cache->buffer, 8);
for (i = 0; i < n_dirs; i++)
{
guint32 name_offset = GET_UINT32 (cache->buffer, dir_list_offset + 4 + 4 * i);
- gchar *name = cache->buffer + name_offset;
+ char *name = cache->buffer + name_offset;
if (strcmp (name, directory) == 0)
return i;
}
return -1;
}
-gint
+int
_gtk_icon_cache_get_directory_index (GtkIconCache *cache,
- const gchar *directory)
+ const char *directory)
{
return get_directory_index (cache, directory);
}
return h;
}
-static gint
+static int
find_image_offset (GtkIconCache *cache,
- const gchar *icon_name,
- gint directory_index)
+ const char *icon_name,
+ int directory_index)
{
guint32 hash_offset;
guint32 n_buckets;
if (chain_offset)
{
guint32 name_offset = GET_UINT32 (cache->buffer, chain_offset + 4);
- gchar *name = cache->buffer + name_offset;
+ char *name = cache->buffer + name_offset;
if (strcmp (name, icon_name) == 0)
goto find_dir;
while (chain_offset != 0xffffffff)
{
guint32 name_offset = GET_UINT32 (cache->buffer, chain_offset + 4);
- gchar *name = cache->buffer + name_offset;
+ char *name = cache->buffer + name_offset;
if (strcmp (name, icon_name) == 0)
{
return 0;
}
-gint
+int
_gtk_icon_cache_get_icon_flags (GtkIconCache *cache,
- const gchar *icon_name,
- gint directory_index)
+ const char *icon_name,
+ int directory_index)
{
guint32 image_offset;
gboolean
_gtk_icon_cache_has_icons (GtkIconCache *cache,
- const gchar *directory)
+ const char *directory)
{
int directory_index;
guint32 hash_offset, n_buckets;
void
_gtk_icon_cache_add_icons (GtkIconCache *cache,
- const gchar *directory,
+ const char *directory,
GHashTable *hash_table)
{
int directory_index;
while (chain_offset != 0xffffffff)
{
guint32 name_offset = GET_UINT32 (cache->buffer, chain_offset + 4);
- gchar *name = cache->buffer + name_offset;
+ char *name = cache->buffer + name_offset;
image_list_offset = GET_UINT32 (cache->buffer, chain_offset + 8);
n_images = GET_UINT32 (cache->buffer, image_list_offset);
gboolean
_gtk_icon_cache_has_icon (GtkIconCache *cache,
- const gchar *icon_name)
+ const char *icon_name)
{
guint32 hash_offset;
guint32 n_buckets;
guint32 chain_offset;
- gint hash;
+ int hash;
hash_offset = GET_UINT32 (cache->buffer, 4);
n_buckets = GET_UINT32 (cache->buffer, hash_offset);
while (chain_offset != 0xffffffff)
{
guint32 name_offset = GET_UINT32 (cache->buffer, chain_offset + 4);
- gchar *name = cache->buffer + name_offset;
+ char *name = cache->buffer + name_offset;
if (strcmp (name, icon_name) == 0)
return TRUE;
gboolean
_gtk_icon_cache_has_icon_in_directory (GtkIconCache *cache,
- const gchar *icon_name,
- const gchar *directory)
+ const char *icon_name,
+ const char *directory)
{
guint32 hash_offset;
guint32 n_buckets;
guint32 chain_offset;
- gint hash;
+ int hash;
gboolean found_icon = FALSE;
- gint directory_index;
+ int directory_index;
directory_index = get_directory_index (cache, directory);
while (chain_offset != 0xffffffff)
{
guint32 name_offset = GET_UINT32 (cache->buffer, chain_offset + 4);
- gchar *name = cache->buffer + name_offset;
+ char *name = cache->buffer + name_offset;
if (strcmp (name, icon_name) == 0)
{
guint32 image_list_offset = GET_UINT32 (cache->buffer, chain_offset + 8);
guint32 n_images = GET_UINT32 (cache->buffer, image_list_offset);
guint32 image_offset = image_list_offset + 4;
- gint i;
+ int i;
for (i = 0; i < n_images; i++)
{
guint16 index = GET_UINT16 (cache->buffer, image_offset);
GdkPixbuf *
_gtk_icon_cache_get_icon (GtkIconCache *cache,
- const gchar *icon_name,
- gint directory_index)
+ const char *icon_name,
+ int directory_index)
{
guint32 offset, image_data_offset, pixel_data_offset;
guint32 length, type;
GHashTable *info_cache;
GList *info_cache_lru;
- gchar *current_theme;
- gchar **search_path;
- gint search_path_len;
+ char *current_theme;
+ char **search_path;
+ int search_path_len;
GList *resource_paths;
guint custom_theme : 1;
};
typedef struct {
- gchar **icon_names;
- gint size;
- gint scale;
+ char **icon_names;
+ int size;
+ int scale;
GtkIconLookupFlags flags;
} IconInfoKey;
IconInfoKey key;
GtkIconTheme *in_cache;
- gchar *filename;
+ char *filename;
GFile *icon_file;
GLoadableIcon *loadable;
GSList *emblem_infos;
* the source was found
*/
IconThemeDirType dir_type;
- gint dir_size;
- gint dir_scale;
- gint min_size;
- gint max_size;
+ int dir_size;
+ int dir_scale;
+ int min_size;
+ int max_size;
/* Parameters influencing the scaled icon
*/
- gint desired_size;
- gint desired_scale;
+ int desired_size;
+ int desired_scale;
guint forced_size : 1;
guint emblems_applied : 1;
guint is_svg : 1;
SymbolicPixbufCache *symbolic_pixbuf_cache;
- gint symbolic_width;
- gint symbolic_height;
+ int symbolic_width;
+ int symbolic_height;
};
typedef struct
{
- gchar *name;
- gchar *display_name;
- gchar *comment;
- gchar *example;
+ char *name;
+ char *display_name;
+ char *comment;
+ char *example;
/* In search order */
GList *dirs;
IconThemeDirType type;
GQuark context;
- gint size;
- gint min_size;
- gint max_size;
- gint threshold;
- gint scale;
+ int size;
+ int min_size;
+ int max_size;
+ int threshold;
+ int scale;
gboolean is_resource;
- gchar *dir;
- gchar *subdir;
- gint subdir_index;
+ char *dir;
+ char *subdir;
+ int subdir_index;
GtkIconCache *cache;
typedef struct
{
- gchar *svg_filename;
- gchar *no_svg_filename;
+ char *svg_filename;
+ char *no_svg_filename;
gboolean is_resource;
} UnthemedIcon;
typedef struct
{
- gint size;
+ int size;
GdkPixbuf *pixbuf;
} BuiltinIcon;
typedef struct
{
- gchar *dir;
+ char *dir;
time_t mtime;
GtkIconCache *cache;
gboolean exists;
static void theme_dir_destroy (IconThemeDir *dir);
static void theme_destroy (IconTheme *theme);
static GtkIconInfo *theme_lookup_icon (IconTheme *theme,
- const gchar *icon_name,
- gint size,
- gint scale,
+ const char *icon_name,
+ int size,
+ int scale,
gboolean allow_svg,
gboolean use_default_icons);
static void theme_list_icons (IconTheme *theme,
GHashTable *icons,
GQuark context);
static gboolean theme_has_icon (IconTheme *theme,
- const gchar *icon_name);
+ const char *icon_name);
static void theme_list_contexts (IconTheme *theme,
GHashTable *contexts);
static void theme_subdir_load (GtkIconTheme *icon_theme,
IconTheme *theme,
GKeyFile *theme_file,
- gchar *subdir);
+ char *subdir);
static void do_theme_change (GtkIconTheme *icon_theme);
static void blow_themes (GtkIconTheme *icon_themes);
static gboolean rescan_themes (GtkIconTheme *icon_themes);
static IconSuffix theme_dir_get_icon_suffix (IconThemeDir *dir,
- const gchar *icon_name,
+ const char *icon_name,
gboolean *has_icon_file);
static GtkIconInfo *icon_info_new (IconThemeDirType type,
- gint dir_size,
- gint dir_scale);
+ int dir_size,
+ int dir_scale);
static GtkIconInfo *gtk_icon_info_new_for_file (GFile *file,
- gint size,
- gint scale);
+ int dir_size,
+ int dir_scale);
static GtkIconInfo *icon_info_new_builtin (BuiltinIcon *icon);
-static IconSuffix suffix_from_name (const gchar *name);
-static BuiltinIcon *find_builtin_icon (const gchar *icon_name,
- gint size,
- gint scale,
- gint *min_difference_p);
+static IconSuffix suffix_from_name (const char *name);
+static BuiltinIcon *find_builtin_icon (const char *icon_name,
+ int size,
+ int scale,
+ int *min_difference_p);
static void remove_from_lru_cache (GtkIconTheme *icon_theme,
GtkIconInfo *icon_info);
static gboolean icon_info_ensure_scale_and_pixbuf (GtkIconInfo* icon_info);
if (!priv->custom_theme)
{
- gchar *theme = NULL;
+ char *theme = NULL;
gboolean changed = FALSE;
if (priv->screen)
{
GSList *formats;
GSList *tmp_list;
- static gint found_svg = -1;
+ static int found_svg = -1;
if (found_svg != -1)
return found_svg;
found_svg = FALSE;
for (tmp_list = formats; tmp_list && !found_svg; tmp_list = tmp_list->next)
{
- gchar **mime_types = gdk_pixbuf_format_get_mime_types (tmp_list->data);
- gchar **mime_type;
+ char **mime_types = gdk_pixbuf_format_get_mime_types (tmp_list->data);
+ char **mime_type;
for (mime_type = mime_types; *mime_type && !found_svg; mime_type++)
{
gtk_icon_theme_init (GtkIconTheme *icon_theme)
{
GtkIconThemePrivate *priv;
- const gchar * const *xdg_data_dirs;
+ const char * const *xdg_data_dirs;
int i, j;
priv = gtk_icon_theme_get_instance_private (icon_theme);
*/
void
gtk_icon_theme_set_search_path (GtkIconTheme *icon_theme,
- const gchar *path[],
- gint n_elements)
+ const char *path[],
+ int n_elements)
{
GtkIconThemePrivate *priv;
- gint i;
+ int i;
g_return_if_fail (GTK_IS_ICON_THEME (icon_theme));
g_free (priv->search_path);
- priv->search_path = g_new (gchar *, n_elements);
+ priv->search_path = g_new (char *, n_elements);
priv->search_path_len = n_elements;
for (i = 0; i < priv->search_path_len; i++)
*/
void
gtk_icon_theme_get_search_path (GtkIconTheme *icon_theme,
- gchar **path[],
- gint *n_elements)
+ char **path[],
+ int *n_elements)
{
GtkIconThemePrivate *priv;
- gint i;
+ int i;
g_return_if_fail (GTK_IS_ICON_THEME (icon_theme));
if (path)
{
- *path = g_new (gchar *, priv->search_path_len + 1);
+ *path = g_new (char *, priv->search_path_len + 1);
for (i = 0; i < priv->search_path_len; i++)
(*path)[i] = g_strdup (priv->search_path[i]);
(*path)[i] = NULL;
*/
void
gtk_icon_theme_append_search_path (GtkIconTheme *icon_theme,
- const gchar *path)
+ const char *path)
{
GtkIconThemePrivate *priv;
priv->search_path_len++;
- priv->search_path = g_renew (gchar *, priv->search_path, priv->search_path_len);
+ priv->search_path = g_renew (char *, priv->search_path, priv->search_path_len);
priv->search_path[priv->search_path_len-1] = g_strdup (path);
do_theme_change (icon_theme);
*/
void
gtk_icon_theme_prepend_search_path (GtkIconTheme *icon_theme,
- const gchar *path)
+ const char *path)
{
GtkIconThemePrivate *priv;
- gint i;
+ int i;
g_return_if_fail (GTK_IS_ICON_THEME (icon_theme));
g_return_if_fail (path != NULL);
priv = icon_theme->priv;
priv->search_path_len++;
- priv->search_path = g_renew (gchar *, priv->search_path, priv->search_path_len);
+ priv->search_path = g_renew (char *, priv->search_path, priv->search_path_len);
for (i = priv->search_path_len - 1; i > 0; i--)
priv->search_path[i] = priv->search_path[i - 1];
*/
void
gtk_icon_theme_add_resource_path (GtkIconTheme *icon_theme,
- const gchar *path)
+ const char *path)
{
GtkIconThemePrivate *priv = NULL;
*/
void
gtk_icon_theme_set_custom_theme (GtkIconTheme *icon_theme,
- const gchar *theme_name)
+ const char *theme_name)
{
GtkIconThemePrivate *priv;
}
}
-static const gchar builtin_hicolor_index[] =
+static const char builtin_hicolor_index[] =
"[Icon Theme]\n"
"Name=Hicolor\n"
"Hidden=True\n"
static void
insert_theme (GtkIconTheme *icon_theme,
- const gchar *theme_name)
+ const char *theme_name)
{
- gint i;
+ int i;
GList *l;
- gchar **dirs;
- gchar **scaled_dirs;
- gchar **themes;
+ char **dirs;
+ char **scaled_dirs;
+ char **themes;
GtkIconThemePrivate *priv;
IconTheme *theme = NULL;
- gchar *path;
+ char *path;
GKeyFile *theme_file;
GError *error = NULL;
IconThemeDirMtime *dir_mtime;
g_slice_free (UnthemedIcon, unthemed_icon);
}
-static gchar *
-strip_suffix (const gchar *filename)
+static char *
+strip_suffix (const char *filename)
{
- const gchar *dot;
+ const char *dot;
if (g_str_has_suffix (filename, ".symbolic.png"))
return g_strndup (filename, strlen(filename)-13);
static void
add_unthemed_icon (GtkIconTheme *icon_theme,
- const gchar *dir,
- const gchar *file,
+ const char *dir,
+ const char *file,
gboolean is_resource)
{
GtkIconThemePrivate *priv = icon_theme->priv;
IconSuffix new_suffix, old_suffix;
- gchar *abs_file;
- gchar *base_name;
+ char *abs_file;
+ char *base_name;
UnthemedIcon *unthemed_icon;
new_suffix = suffix_from_name (file);
{
GtkIconThemePrivate *priv;
GDir *gdir;
- gint base;
- gchar *dir;
- const gchar *file;
+ int base;
+ char *dir;
+ const char *file;
GTimeVal tv;
IconThemeDirMtime *dir_mtime;
GStatBuf stat_buf;
for (d = priv->resource_paths; d; d = d->next)
{
- gchar **children;
- gint i;
+ char **children;
+ int i;
dir = d->data;
children = g_resources_enumerate_children (dir, 0, NULL);
}
static gboolean
-icon_name_is_symbolic (const gchar *icon_name)
+icon_name_is_symbolic (const char *icon_name)
{
return g_str_has_suffix (icon_name, "-symbolic")
|| g_str_has_suffix (icon_name, "-symbolic-ltr")
}
static gboolean
-icon_uri_is_symbolic (const gchar *icon_name)
+icon_uri_is_symbolic (const char *icon_name)
{
return g_str_has_suffix (icon_name, "-symbolic.svg")
|| g_str_has_suffix (icon_name, "-symbolic-ltr.svg")
static GtkIconInfo *
real_choose_icon (GtkIconTheme *icon_theme,
- const gchar *icon_names[],
- gint size,
- gint scale,
+ const char *icon_names[],
+ int size,
+ int scale,
GtkIconLookupFlags flags)
{
GtkIconThemePrivate *priv;
GtkIconInfo *icon_info = NULL;
GtkIconInfo *unscaled_icon_info;
UnthemedIcon *unthemed_icon = NULL;
- const gchar *icon_name = NULL;
+ const char *icon_name = NULL;
gboolean allow_svg;
gboolean use_builtin;
IconTheme *theme = NULL;
- gint i;
+ int i;
IconInfoKey key;
priv = icon_theme->priv;
ensure_valid_themes (icon_theme);
- key.icon_names = (gchar **)icon_names;
+ key.icon_names = (char **)icon_names;
key.size = size;
key.scale = scale;
key.flags = flags;
/* Still not found an icon, check if reference to a Win32 resource */
if (!unthemed_icon)
{
- gchar **resources;
+ char **resources;
HICON hIcon = NULL;
resources = g_strsplit (icon_names[0], ",", 0);
if (unthemed_icon->is_resource)
{
- gchar *uri;
+ char *uri;
uri = g_strconcat ("resource://", icon_info->filename, NULL);
icon_info->icon_file = g_file_new_for_uri (uri);
g_free (uri);
else
{
static gboolean check_for_default_theme = TRUE;
- gchar *default_theme_path;
+ char *default_theme_path;
gboolean found = FALSE;
if (check_for_default_theme)
static void
icon_name_list_add_icon (GPtrArray *icons,
- const gchar *dir_suffix,
- gchar *icon_name)
+ const char *dir_suffix,
+ char *icon_name)
{
if (dir_suffix)
g_ptr_array_add (icons, g_strconcat (icon_name, dir_suffix, NULL));
static GtkIconInfo *
choose_icon (GtkIconTheme *icon_theme,
- const gchar *icon_names[],
- gint size,
- gint scale,
+ const char *icon_names[],
+ int size,
+ int scale,
GtkIconLookupFlags flags)
{
gboolean has_regular = FALSE, has_symbolic = FALSE;
GtkIconInfo *icon_info;
GPtrArray *new_names;
- const gchar *dir_suffix;
+ const char *dir_suffix;
guint i;
if (flags & GTK_ICON_LOOKUP_DIR_LTR)
g_ptr_array_add (new_names, NULL);
icon_info = real_choose_icon (icon_theme,
- (const gchar **) new_names->pdata,
+ (const char **) new_names->pdata,
size,
scale,
flags & ~(GTK_ICON_LOOKUP_FORCE_REGULAR | GTK_ICON_LOOKUP_FORCE_SYMBOLIC));
g_ptr_array_add (new_names, NULL);
icon_info = real_choose_icon (icon_theme,
- (const gchar **) new_names->pdata,
+ (const char **) new_names->pdata,
size,
scale,
flags & ~(GTK_ICON_LOOKUP_FORCE_REGULAR | GTK_ICON_LOOKUP_FORCE_SYMBOLIC));
g_ptr_array_add (new_names, NULL);
icon_info = real_choose_icon (icon_theme,
- (const gchar **) new_names->pdata,
+ (const char **) new_names->pdata,
size,
scale,
flags & ~(GTK_ICON_LOOKUP_FORCE_REGULAR | GTK_ICON_LOOKUP_FORCE_SYMBOLIC));
*/
GtkIconInfo *
gtk_icon_theme_lookup_icon (GtkIconTheme *icon_theme,
- const gchar *icon_name,
- gint size,
+ const char *icon_name,
+ int size,
GtkIconLookupFlags flags)
{
g_return_val_if_fail (GTK_IS_ICON_THEME (icon_theme), NULL);
*/
GtkIconInfo *
gtk_icon_theme_lookup_icon_for_scale (GtkIconTheme *icon_theme,
- const gchar *icon_name,
- gint size,
- gint scale,
+ const char *icon_name,
+ int size,
+ int scale,
GtkIconLookupFlags flags)
{
GtkIconInfo *info;
if (flags & GTK_ICON_LOOKUP_GENERIC_FALLBACK)
{
- gchar **names, **nonsymbolic_names;
- gint dashes, i;
- gchar *p, *nonsymbolic_icon_name;
+ char **names, **nonsymbolic_names;
+ int dashes, i;
+ char *p, *nonsymbolic_icon_name;
gboolean is_symbolic;
is_symbolic = icon_name_is_symbolic (icon_name);
nonsymbolic_icon_name = g_strdup (icon_name);
dashes = 0;
- for (p = (gchar *) nonsymbolic_icon_name; *p; p++)
+ for (p = (char *) nonsymbolic_icon_name; *p; p++)
if (*p == '-')
dashes++;
- nonsymbolic_names = g_new (gchar *, dashes + 2);
+ nonsymbolic_names = g_new (char *, dashes + 2);
nonsymbolic_names[0] = nonsymbolic_icon_name;
for (i = 1; i <= dashes; i++)
if (is_symbolic)
{
- names = g_new (gchar *, 2 * dashes + 3);
+ names = g_new (char *, 2 * dashes + 3);
for (i = 0; nonsymbolic_names[i] != NULL; i++)
{
names[i] = g_strconcat (nonsymbolic_names[i], "-symbolic", NULL);
names = nonsymbolic_names;
}
- info = choose_icon (icon_theme, (const gchar **) names, size, scale, flags);
+ info = choose_icon (icon_theme, (const char **) names, size, scale, flags);
g_strfreev (names);
}
else
{
- const gchar *names[2];
+ const char *names[2];
names[0] = icon_name;
names[1] = NULL;
*/
GtkIconInfo *
gtk_icon_theme_choose_icon (GtkIconTheme *icon_theme,
- const gchar *icon_names[],
- gint size,
+ const char *icon_names[],
+ int size,
GtkIconLookupFlags flags)
{
g_return_val_if_fail (GTK_IS_ICON_THEME (icon_theme), NULL);
*/
GtkIconInfo *
gtk_icon_theme_choose_icon_for_scale (GtkIconTheme *icon_theme,
- const gchar *icon_names[],
- gint size,
- gint scale,
+ const char *icon_names[],
+ int size,
+ int scale,
GtkIconLookupFlags flags)
{
g_return_val_if_fail (GTK_IS_ICON_THEME (icon_theme), NULL);
*/
GdkPixbuf *
gtk_icon_theme_load_icon (GtkIconTheme *icon_theme,
- const gchar *icon_name,
- gint size,
+ const char *icon_name,
+ int size,
GtkIconLookupFlags flags,
GError **error)
{
*/
GdkPixbuf *
gtk_icon_theme_load_icon_for_scale (GtkIconTheme *icon_theme,
- const gchar *icon_name,
- gint size,
- gint scale,
+ const char *icon_name,
+ int size,
+ int scale,
GtkIconLookupFlags flags,
GError **error)
{
*/
cairo_surface_t *
gtk_icon_theme_load_surface (GtkIconTheme *icon_theme,
- const gchar *icon_name,
- gint size,
- gint scale,
+ const char *icon_name,
+ int size,
+ int scale,
GdkWindow *for_window,
GtkIconLookupFlags flags,
GError **error)
*/
gboolean
gtk_icon_theme_has_icon (GtkIconTheme *icon_theme,
- const gchar *icon_name)
+ const char *icon_name)
{
GtkIconThemePrivate *priv;
GList *l;
gpointer value,
gpointer user_data)
{
- gint **res_p = user_data;
+ int **res_p = user_data;
**res_p = GPOINTER_TO_INT (key);
*
* Since: 2.6
*/
-gint *
+int *
gtk_icon_theme_get_icon_sizes (GtkIconTheme *icon_theme,
- const gchar *icon_name)
+ const char *icon_name)
{
GList *l, *d, *icons;
GHashTable *sizes;
- gint *result, *r;
+ int *result, *r;
guint suffix;
GtkIconThemePrivate *priv;
}
}
- r = result = g_new0 (gint, g_hash_table_size (sizes) + 1);
+ r = result = g_new0 (int, g_hash_table_size (sizes) + 1);
g_hash_table_foreach (sizes, add_size, &r);
g_hash_table_destroy (sizes);
*/
GList *
gtk_icon_theme_list_icons (GtkIconTheme *icon_theme,
- const gchar *context)
+ const char *context)
{
GtkIconThemePrivate *priv;
GHashTable *icons;
*
* Since: 2.4
*/
-gchar *
+char *
gtk_icon_theme_get_example_icon_name (GtkIconTheme *icon_theme)
{
GtkIconThemePrivate *priv;
GtkIconThemePrivate *priv;
IconThemeDirMtime *dir_mtime;
GList *d;
- gint stat_res;
+ int stat_res;
GStatBuf stat_buf;
GTimeVal tv;
static int
theme_dir_size_difference (IconThemeDir *dir,
- gint size,
- gint scale)
+ int size,
+ int scale)
{
- gint scaled_size, scaled_dir_size;
- gint min, max;
+ int scaled_size, scaled_dir_size;
+ int min, max;
scaled_size = size * scale;
scaled_dir_size = dir->size * dir->scale;
return 1000;
}
-static const gchar *
+static const char *
string_from_suffix (IconSuffix suffix)
{
switch (suffix)
}
static IconSuffix
-suffix_from_name (const gchar *name)
+suffix_from_name (const char *name)
{
IconSuffix retval = ICON_SUFFIX_NONE;
static IconSuffix
theme_dir_get_icon_suffix (IconThemeDir *dir,
- const gchar *icon_name,
+ const char *icon_name,
gboolean *has_icon_file)
{
IconSuffix suffix, symbolic_suffix;
/* returns TRUE if dir_a is a better match */
static gboolean
-compare_dir_matches (IconThemeDir *dir_a, gint difference_a,
- IconThemeDir *dir_b, gint difference_b,
- gint requested_size,
- gint requested_scale)
+compare_dir_matches (IconThemeDir *dir_a, int difference_a,
+ IconThemeDir *dir_b, int difference_b,
+ int requested_size,
+ int requested_scale)
{
- gint diff_a;
- gint diff_b;
+ int diff_a;
+ int diff_b;
if (difference_a == 0)
{
static GtkIconInfo *
theme_lookup_icon (IconTheme *theme,
- const gchar *icon_name,
- gint size,
- gint scale,
+ const char *icon_name,
+ int size,
+ int scale,
gboolean allow_svg,
gboolean use_builtin)
{
GList *dirs, *l;
IconThemeDir *dir, *min_dir;
- gchar *file;
- gint min_difference, difference;
+ char *file;
+ int min_difference, difference;
BuiltinIcon *closest_builtin = NULL;
IconSuffix suffix;
if (min_dir->is_resource)
{
- gchar *uri;
+ char *uri;
uri = g_strconcat ("resource://", icon_info->filename, NULL);
icon_info->icon_file = g_file_new_for_uri (uri);
g_free (uri);
static gboolean
theme_has_icon (IconTheme *theme,
- const gchar *icon_name)
+ const char *icon_name)
{
GList *l;
{
GList *l = theme->dirs;
IconThemeDir *dir;
- const gchar *context;
+ const char *context;
while (l != NULL)
{
static gboolean
scan_directory (GtkIconThemePrivate *icon_theme,
IconThemeDir *dir,
- gchar *full_dir)
+ char *full_dir)
{
GDir *gdir;
- const gchar *name;
+ const char *name;
GTK_NOTE (ICONTHEME, g_message ("scanning directory %s", full_dir));
while ((name = g_dir_read_name (gdir)))
{
- gchar *base_name;
+ char *base_name;
IconSuffix suffix, hash_suffix;
suffix = suffix_from_name (name);
static gboolean
scan_resources (GtkIconThemePrivate *icon_theme,
IconThemeDir *dir,
- gchar *full_dir)
+ char *full_dir)
{
- gint i;
- gchar **children;
+ int i;
+ char **children;
GTK_NOTE (ICONTHEME, g_message ("scanning resources %s", full_dir));
for (i = 0; children[i]; i++)
{
- gchar *base_name;
+ char *base_name;
IconSuffix suffix, hash_suffix;
suffix = suffix_from_name (children[i]);
theme_subdir_load (GtkIconTheme *icon_theme,
IconTheme *theme,
GKeyFile *theme_file,
- gchar *subdir)
+ char *subdir)
{
GList *d;
- gchar *type_string;
+ char *type_string;
IconThemeDir *dir;
IconThemeDirType type;
- gchar *context_string;
+ char *context_string;
GQuark context;
- gint size;
- gint min_size;
- gint max_size;
- gint threshold;
- gchar *full_dir;
+ int size;
+ int min_size;
+ int max_size;
+ int threshold;
+ char *full_dir;
GError *error = NULL;
IconThemeDirMtime *dir_mtime;
- gint scale;
+ int scale;
gboolean has_icons;
size = g_key_file_get_integer (theme_file, subdir, "Size", &error);
for (d = icon_theme->priv->resource_paths; d; d = d->next)
{
/* Force a trailing / here, to avoid extra copies in GResource */
- full_dir = g_build_filename ((const gchar *)d->data, subdir, " ", NULL);
+ full_dir = g_build_filename ((const char *)d->data, subdir, " ", NULL);
full_dir[strlen (full_dir) - 1] = '\0';
dir = g_new0 (IconThemeDir, 1);
dir->type = type;
static GtkIconInfo *
icon_info_new (IconThemeDirType type,
- gint dir_size,
- gint dir_scale)
+ int dir_size,
+ int dir_scale)
{
GtkIconInfo *icon_info;
*
* Since: 2.4
*/
-gint
+int
gtk_icon_info_get_base_size (GtkIconInfo *icon_info)
{
g_return_val_if_fail (icon_info != NULL, 0);
*
* Since: 3.10
*/
-gint
+int
gtk_icon_info_get_base_scale (GtkIconInfo *icon_info)
{
g_return_val_if_fail (icon_info != NULL, 0);
*
* Since: 2.4
*/
-const gchar *
+const char *
gtk_icon_info_get_filename (GtkIconInfo *icon_info)
{
g_return_val_if_fail (icon_info != NULL, NULL);
gboolean
gtk_icon_info_is_symbolic (GtkIconInfo *icon_info)
{
- gchar *icon_uri;
+ char *icon_uri;
gboolean is_symbolic;
g_return_val_if_fail (GTK_IS_ICON_INFO (icon_info), FALSE);
*/
static GdkPixbuf *
_gdk_pixbuf_new_from_stream_scaled (GInputStream *stream,
- gdouble scale,
+ double scale,
GCancellable *cancellable,
GError **error)
{
*/
static GdkPixbuf *
_gdk_pixbuf_new_from_resource_scaled (const char *resource_path,
- gdouble scale,
+ double scale,
GError **error)
{
GInputStream *stream;
GtkIconInfo *info)
{
GdkPixbuf *icon = NULL;
- gint w, h, pos;
+ int w, h, pos;
GSList *l;
if (info->emblem_infos == NULL)
if (icon_info_ensure_scale_and_pixbuf (emblem_info))
{
GdkPixbuf *emblem = emblem_info->pixbuf;
- gint ew, eh;
- gint x = 0, y = 0; /* silence compiler */
+ int ew, eh;
+ int x = 0, y = 0; /* silence compiler */
gdouble scale;
ew = gdk_pixbuf_get_width (emblem);
static gboolean
icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info)
{
- gint image_width, image_height, image_size;
- gint scaled_desired_size;
+ int image_width, image_height, image_size;
+ int scaled_desired_size;
GdkPixbuf *source_pixbuf;
gdouble dir_scale;
{
if (icon_info->is_svg)
{
- gint size;
+ int size;
if (icon_info->forced_size || icon_info->dir_type == ICON_THEME_DIR_UNTHEMED)
size = scaled_desired_size;
*/
if (icon_info->is_svg)
{
- gint size;
+ int size;
if (icon_info->forced_size || icon_info->dir_type == ICON_THEME_DIR_UNTHEMED)
size = scaled_desired_size;
if (warn_about_load_failure)
{
- gchar *path;
+ char *path;
if (icon_info->is_resource)
path = g_strdup (icon_info->filename);
return symbolic_cache->proxy_pixbuf;
}
-static gchar *
+static char *
rgba_to_string_noalpha (const GdkRGBA *rgba)
{
GdkRGBA color;
static void
rgba_to_pixel(const GdkRGBA *rgba,
- guint8 pixel[4])
+ uint8_t pixel[4])
{
pixel[0] = rgba->red * 255;
pixel[1] = rgba->green * 255;
guchar *src_row, *dst_row;
int alpha;
GdkPixbuf *colored;
- guint8 fg_pixel[4], success_pixel[4], warning_pixel[4], error_pixel[4];
+ uint8_t fg_pixel[4], success_pixel[4], warning_pixel[4], error_pixel[4];
alpha = fg_color->alpha * 255;
{
GInputStream *stream;
GdkPixbuf *pixbuf;
- gchar *css_fg;
- gchar *css_success;
- gchar *css_warning;
- gchar *css_error;
- gchar *data;
- gchar *width;
- gchar *height;
- gchar *file_data, *escaped_file_data;
+ char *css_fg;
+ char *css_success;
+ char *css_warning;
+ char *css_error;
+ char *data;
+ char *width;
+ char *height;
+ char *file_data, *escaped_file_data;
gsize file_len;
- gint symbolic_size;
+ int symbolic_size;
double alpha;
- gchar alphastr[G_ASCII_DTOSTR_BUF_SIZE];
+ char alphastr[G_ASCII_DTOSTR_BUF_SIZE];
alpha = fg->alpha;
gboolean
gtk_icon_info_get_attach_points (GtkIconInfo *icon_info,
GdkPoint **points,
- gint *n_points)
+ int *n_points)
{
return FALSE;
}
*
* Deprecated: 3.14: Display names are deprecated
*/
-const gchar *
+const char *
gtk_icon_info_get_display_name (GtkIconInfo *icon_info)
{
return NULL;
* to add application-specific icons to the icon theme.
*/
void
-gtk_icon_theme_add_builtin_icon (const gchar *icon_name,
- gint size,
- GdkPixbuf *pixbuf)
+gtk_icon_theme_add_builtin_icon (const char *icon_name,
+ int size,
+ GdkPixbuf *pixbuf)
{
BuiltinIcon *default_icon;
GSList *icons;
* for how they are used.
*/
static BuiltinIcon *
-find_builtin_icon (const gchar *icon_name,
- gint size,
- gint scale,
- gint *min_difference_p)
+find_builtin_icon (const char *icon_name,
+ int size,
+ int scale,
+ int *min_difference_p)
{
GSList *icons = NULL;
- gint min_difference = G_MAXINT;
+ int min_difference = G_MAXINT;
gboolean has_larger = FALSE;
BuiltinIcon *min_icon = NULL;
GtkIconInfo *
gtk_icon_theme_lookup_by_gicon (GtkIconTheme *icon_theme,
GIcon *icon,
- gint size,
+ int size,
GtkIconLookupFlags flags)
{
return gtk_icon_theme_lookup_by_gicon_for_scale (icon_theme, icon,
GtkIconInfo *
gtk_icon_theme_lookup_by_gicon_for_scale (GtkIconTheme *icon_theme,
GIcon *icon,
- gint size,
- gint scale,
+ int size,
+ int scale,
GtkIconLookupFlags flags)
{
GtkIconInfo *info;
if ((flags & GTK_ICON_LOOKUP_FORCE_SIZE) != 0)
{
- gint width, height, max;
+ int width, height, max;
gdouble pixbuf_scale;
GdkPixbuf *scaled;
}
else if (G_IS_THEMED_ICON (icon))
{
- const gchar **names;
+ const char **names;
- names = (const gchar **)g_themed_icon_get_names (G_THEMED_ICON (icon));
+ names = (const char **)g_themed_icon_get_names (G_THEMED_ICON (icon));
info = gtk_icon_theme_choose_icon_for_scale (icon_theme, names, size, scale, flags);
return info;
static GtkIconInfo *
gtk_icon_info_new_for_file (GFile *file,
- gint size,
- gint scale)
+ int size,
+ int scale)
{
GtkIconInfo *info;
if (info->is_resource)
{
- gchar *uri;
+ char *uri;
uri = g_file_get_uri (file);
info->filename = g_strdup (uri + 11); /* resource:// */